﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Data;
using CPETwit.WPFClient.Business.TwitterServiceReference;
using CPETwit.WPFClient.Common;

namespace CPETwit.WPFClient.Converter
{
    public class TweetToLabelVisibilityConverter:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if(value is Tweet)
            {
                Tweet tweet = value as Tweet;
                return tweet.UserFromProperty == null
                           ? Visibility.Collapsed
                           : Visibility.Visible;
            }
            return null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
